<?php
	if(!isset($_REQUEST['ajax'])){ $_REQUEST['ajax'] = "";}
	if($_REQUEST['ajax']!=true) include 'header.tpl.php';
	include 'usercp_panel.tpl.php';
?>
	<div class="row">
		<div class="col-lg-8">
			<div class="panel">
				<div class="panel-heading">
					<div class="panel-title"><i class="icon-comments"></i> Nội dung</div>
				</div>
				<div class="panel-body">
					<p>
						<b>Tiêu đề : </b><font color=red><?php echo $this->item['msgTitle'];?></font>
					</p><hr/>
					<p>
						<?php echo $this->item['msgContent'];?>
					</p>
					<?php if($_SESSION['userId']!=$this->item['msgSender'] && $this->item['msgSender']!=0) {?>
					<p>
						<a class="btn btn-primary" href='javascript:;' onClick="replyMsg('<?php echo $this->item['msgId'];?>');">Trả lời</a>
					</p>
					<?php } ?>
				</div>
			</div>
		</div>
		<div class="col-lg-4">
			<div class="panel">
				<div class="panel-heading">
					<div class="panel-title"><i class="icon-comments-alt"></i> Thông tin chung</div>
				</div>
				<div class="panel-body">
					<ul class="list-group">
						<li class="list-group-item">
							<b>Người gửi</b>
							<span class="pull-right"><?php if($this->item['msgSender']==0){ echo "Hệ thống";}else{ echo "<a href='#user_view/uId=".$this->item['msgSender']."'>".$_SESSION['user_data'][$this->item['msgSender']]['fullname']."</a>";}?></span>
						</li>
						<li class="list-group-item">
							<b>Người nhận</b>
							<span class="pull-right"><a href='#user_view/uId=<?php echo $this->item['msgReceiver'];?>'><?php echo $_SESSION['user_data'][$this->item['msgReceiver']]['fullname'];?></a></span>
						</li>
						<li class="list-group-item">
							<b>Thời gian gửi</b>
							<span class="pull-right"><?php echo date("H:m:s d/m/Y",$this->item['msgTime']);?></span>
						</li>
						<li class="list-group-item">
							<b>File đính kèm</b>
							<span class="pull-right">
								<?php
									if($this->item['msgFile']!=""){
										$f1 = explode(";",$this->item['msgFile']);
										echo "<ul>";
										foreach($f1 as $file){
											echo "<li><a href='download.php?file=".$file."'>$file</a></li>";
										}
										echo "</ul>";
									}
									else echo "Kh&#244;ng c&#243;";
								?>
							</span>
						</li>
					</ul>
				</div>
			</div>
		</div>
	</div>
<?php if(isset($this->breadcrumb) && isset($this->title_header)):?>
	<script type="text/javascript">
		$(function() {
			$("#title-header").text('<?php echo $this->title_header;?>');
			$("#breadcrumb").html('<?php echo build_breadcrumb($this->breadcrumb);?>');
		});
	</script>
<?php endif;?>
<?php
	if($_REQUEST['ajax']!=true) include 'footer.tpl.php';
?>